
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>购物车登录页面</title>

    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        body{
            background-color: #DCDFE4;
            width: 1519.2px;
            height: 1000px;
        }
        .header{
            width: 899px;
            height: 66px;
            margin: 24px auto 0;
        }
        .w{
            width: 899px;
            margin: auto;
        }
        .main_top{
            width: 899px;
            height: 654px;
            background-color: white;
            margin: auto;
        }
        .main_reg h2 {
            width: 899px;
            height: 60px;
            font-size: 18px;
            font-family: "Microsoft YaHei";
            color: #666666;
            font-weight: normal;
            text-indent: 37px;
            line-height: 60px;
        }
        .empty_place{
            width: 100%;
            height: 65px;
        }


        .input_left {
            width: 578px;
            height: 528px;
            border-right: solid 1px #e4e4e4;
            float: left;
        }
        .text_start {
            width: 75px;
            height: 35px;
            display: block;
            float: left;
            line-height: 35px;
            font-family: "Microsoft YaHei";
            font-size: 14px;
            color: #5b5b5b;
            text-align: right;
            padding-right: 15px;
        }
        .username1 {
            height: 35px;
            padding-left: 59px;
            padding-bottom: 35px;
            padding-bottom: 15px;
        }
        .text_middle {
            width: 255px;
            height: 35px;
            border: solid;
            display: block;
            float: left;
            line-height: 35px;
            text-indent: 1em;
            color: #a1a1a1;
        }
        .reg_box {
            width: 430px;
            height: 45px;
            padding-left: 148px;
            padding-bottom: 10px;

        }
        .reg_ok {
            width: 263px;
            height: 45px;
            border: none;
            background: #66DD00 no-repeat center center;
            font-family: "Microsoft YaHei";
            font-size: 20px;
            color: #ffffff;
            cursor: pointer;
        }
        button {
            appearance: auto;
            -webkit-writing-mode: horizontal-tb !important;
            text-rendering: auto;
            color: -internal-light-dark(black, white);
            letter-spacing: normal;
            word-spacing: normal;
            text-transform: none;
            text-indent: 0px;
            text-shadow: none;
            display: inline-block;
            text-align: center;
            align-items: flex-start;
            cursor: default;
            background-color: -internal-light-dark(rgb(239, 239, 239), rgb(59, 59, 59));
            box-sizing: border-box;
            margin: 0em;
            font: 400 13.3333px Arial;
            padding: 1px 6px;
            border-width: 2px;
            border-style: outset;
            border-color: -internal-light-dark(rgb(118, 118, 118), rgb(133, 133, 133));
            border-image: initial;

        }
        .input_right {
            float: left;
            padding: 30px 0 0 28px;

        }

        .inpur_right h3{

            padding-left: 20px;


        }
        .input_right a{
            text-decoration:none;
            color: black;
        }
    </style>
</head>
<body>
<!--head页面-->
<div class=" header w">
    <div class="logo">
        <img src=" ">
    </div>
</div>
<!--head页面-->
<!--主体页面-->
<div class="main_top">
    <div class="main_reg">
        <h2>登录</h2>
    </div>

    <div class="empty_place">
    </div>

    <div class="main_input">
        <div class="input_left">
            <div class="username1">
                <span class="text_start">用户名：</span>
                <input type="text" id="username" required="required" class="text_middle">
            </div>

            <div class="username1">
                <span class="text_start">密&nbsp;&nbsp;&nbsp; 码：</span>
                <input id="pwd" type="password " required="required" class="text_middle">
            </div>

            <div class="reg_box">
                <button class="reg_ok" value="登入" id="login" onclick="login();">登入</button>

            </div>
            <div class="reg_box">

                <button class="reg_ok" value="去注册"  id="register" onclick="register();">注册</button>

            </div>

            <div class="reg_box">

                <button class="reg_ok" value="找回密码" id="findPwd" onclick="findPwd();">找回密码</button>
            </div>

        </div>
        <div class="input_right">
            <h3>广告招租</h3><br>
            <a href="#">联系我们：1869407****</a>
        </div>

    </div>
</div>
<!--主体页面-->
</body>
</html>


<script type="text/javascript" src="static/js/layui/layui.js"></script>
<script >
    layui.use('layer', function() {
        var $ = layui.jquery, layer = layui.layer;
    });
    function login() {
        var $ = layui.jquery, layer = layui.layer;
        var username=$("#username").val();
        var pwd=$("#pwd").val();
        if(null==username||''==username){
            alert("用户名不能为空");
            return;
        }else if(null==pwd||''==pwd){
            alert("密码不能为空");
            return;
        }else{
            $.ajax({
                url:"login?action=login",
                type:'post',
                data:{username:username,pwd:pwd},
                success:function(data){
                    if(data==0){
                        window.location.href="goodsList";
                    }else{
                        alert("登录失败，账号或者密码错误");
                    }
                },
                complete: function () {
                    layer.close(this.layerIndex);
                },
            });
        }
    }

    //注册跳转
    function register() {
        window.location.href="register";
    }

    function findPwd() {
        window.location.href="login?action=findPwd";
    }
</script>
</html>
